import axios from 'axios';
import selfNaxios from 'utils/ajaxConfig.js';

export function addWorkFileList (param, success, error) {
  return selfNaxios({
      method : 'post',
      url : '/project/insert',
      data: param
    }, success, error)
}

export function getManagerList (param, success, error) {
  return selfNaxios({
      method : 'get',
      url : '/project/queryManager',
      params: param
    }, success, error)
}



export function searchAddParticipantList (param, success, error) {
  return selfNaxios({
      method : 'get',
      url : '/enterprise/search',
      params: param
    }, success, error)
}

export function workFileSearchAddGroupList (param, success, error) {
  return selfNaxios({
      method : 'post',
      url : '/team/search',
      data: param
    }, success, error)
}

export function getUserBaseDataUrl (param, success, error) {
  return selfNaxios({
      method : 'get',
      url : '/user/me',
      params: param
    }, success, error)
}


export function editWorkFileList (param, success, error) {
  return selfNaxios({
      method : 'post',
      url : '/project/update',
      data: param
    }, success, error)
}

export function endWorkFileList (param) {
  return axios({
      method : 'post',
      url : '/project/end',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function searchItemWorkFileList (param, success, error) {
  return selfNaxios({
      method : 'get',
      url : '/project/' + param.id
    }, success, error)
}

export function searchPkFromNc (param, success, error) {
  return selfNaxios({
      method : 'get',
      url : '/project/queryBySrc',
      params: param,
    }, success, error)
}

export function deleteWorkFileList (param) {
  return axios({
      method : 'post',
      url : '/project/delete',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function workFileGroupList (param) {
  return axios({
      method : 'get',
      url : '/team/members',
      params: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function workFileDeleteGroupList (param) {
  return axios({
      method : 'post',
      url : '/team/remove',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}


export function workFileAddGroupList (param) {
  return axios({
      method : 'get',
      url : '/team/search',
      params: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function addGroupItem (param) {
  return axios({
      method : 'post',
      url : '/team/addMembers',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function workFileAddParticipantList (param) {
  return axios({
      method : 'get',
      url : '/teamEnt/ents',
      params: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function addParticipantItem (param) {
  return axios({
      method : 'post',
      url : '/teamEnt/add',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function workFileDeleteParticipantList (param) {
  return axios({
      method : 'post',
      url : '/teamEnt/remove',
      data: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}


export function checkGroupStatus (param) {
  return axios({
      method : 'get',
      url : '/teamEnt/count',
      params: param,
      headers: {
        'Cache-Control': 'no-cache'
      }
    })
}

export function searchWorkProList (param) {
	return axios({
      method : 'get',
      url : '/procedure/list',
      headers: {
        'Cache-Control': 'no-cache'
      },
      params: param
    })
}